package com.tuanbiao.ui.upload;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.hzjq.data.hzjq.entity.CapRecordEntity;
import com.tuanbiao.R;

/**
 * @author abiao
 * @since 2022/4/24 16:40
 */
public class UploadDataDetailsAdapter extends BaseQuickAdapter<CapRecordEntity, BaseViewHolder> {
    public UploadDataDetailsAdapter() {
        super(R.layout.item_detonator_upload_details);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, CapRecordEntity entity) {
        holder.setText(R.id.tv_location, getContext().getString(R.string.detonator_register_adapter_location
                , entity.getRowNumber(), entity.getHoleNumber()))
                .setText(R.id.tv_code, entity.getConvertUid())
                .setText(R.id.tv_delay, getContext().getString(R.string.detonator_register_adapter_init_delay, entity.getDelay()))
                .setText(R.id.tv_status, entity.getStatus());
//        if(entity.isBlastError()){
//            holder.setTextColorRes(R.id.tv_location,R.color.red)
//                    .setTextColorRes(R.id.tv_code,R.color.red)
//                    .setTextColorRes(R.id.tv_delay,R.color.red)
//                    .setTextColorRes(R.id.tv_status,R.color.red);
//        } else if(entity.isForceAuthBlast()){
//            holder.setTextColorRes(R.id.tv_location, R.color.orange)
//                    .setTextColorRes(R.id.tv_code,R.color.orange)
//                    .setTextColorRes(R.id.tv_delay,R.color.orange)
//                    .setTextColorRes(R.id.tv_status,R.color.orange);
//        } else {
            holder.setTextColorRes(R.id.tv_location,R.color.black)
                    .setTextColorRes(R.id.tv_code,R.color.black)
                    .setTextColorRes(R.id.tv_delay,R.color.black)
                    .setTextColorRes(R.id.tv_status,R.color.black);
//        }
    }
}
